<template>
  <div class="goods-info">
    <goods-search
      ref="goodsSearchRef"
      @handler-search-click="handlerSearchClick"
      @handler-reset-click="handlerResetClick"
    />
    <goods-content ref="goodsContentRef" @new-data-product="newDataProduct" />
    <goods-modal ref="goodsModalRef" />
  </div>
</template>

<script setup lang="ts">
import goodsSearch from './cpns/goods-search.vue'
import goodsContent from './cpns/goods-content.vue'
import goodsModal from './cpns/goods-modal.vue'
import { ref } from 'vue'
const goodsSearchRef = ref<InstanceType<typeof goodsSearch>>()
const goodsModalRef = ref<InstanceType<typeof goodsModal>>()
const goodsContentRef = ref<InstanceType<typeof goodsContent>>()
// 搜索
function handlerSearchClick(formVal: any) {
  goodsContentRef.value?.postProductList(formVal)
}
// 重置
function handlerResetClick() {
  goodsContentRef.value?.postProductList()
}
// 添加
function newDataProduct() {
  goodsModalRef.value?.setDialogVisible()
}
</script>

<style lang="less" scoped>
.goods-info {
}
</style>
